package com.classingWork.demo;

import java.util.Scanner;

/**
 * @author AYQ
 * @Title: text
 * @Description:
 * @date 2020/4/1014:46
 */
public class Demo1 {
    public static void main(String[] args) {
        //声明数值-整型数组
        int[] a={1,2,3,4,5,6};
        float []b ={1,2,3,4,5,6};
        //必须要声明 数组的长度或者大小
        int[] c=new int[6];
        //数组的赋值
        /**Scanner input = new Scanner(System.in);
        int keyValue = input.nextInt();

        c[0]=keyValue;
        c[1]=1;
        c[2]=2;*/
        //如何去调用数组的长度？ 数组变量  .length
        for (int i = 0 ; i  < c.length; i++){
            c[i] = i + 1 ;
        }
        //输出？
        //foreach循环，这种循环遍历数组和集合更简洁
        for (int temp : c){
            System.out.println(temp);
        }
        int[] d = new int[6];
        d = a;
        d[0] = 999;
        for(int temp : a) {
            System.out.println(temp);
        }
    }


}

